{template 'common/header'}
<style type='text/css'>
       .trbody td {text-align: center; vertical-align:top;border-left:1px solid #ccc; border-bottom: 1px solid #ddd;}
.column_bg{
	 background:rgba(0, 0, 0, 0.52); width:100%;
	 height:100%;
	 position:fixed;
	 top:0;
	 left:0;
	 z-index:1000;
}
.column{
	 background:#fff;
	 width:35%;
	 margin:10% auto;
	 border-radius:8px;
	 overflow: hidden;
}
.column h3{
	background:#5bc0de;
	color:#fff;
	font-size:24px;
	height:45px;
	line-height:45px;
	text-align:center;
	margin:0;
	}
.column_center{
	width:100%;
	padding:3% 2%;
	overflow:hidden;
	} 
.column_center p{
    width: 100% !important;
    height: 45px !important;
    line-height: 45px !important;
    text-align: right !important;
    padding-right: 16%;
	margin:4% 0 !important;
	}
.column_center p span{width:29% !important;}
.column_center p select{
    width: 70%;
    height: 34px;
	}
.column_center p input{
    width: 70%;
    height: 35px;
    margin-left: 1%;
    line-height: 35px;
	padding-left: 1%;
	}	
.column p{
    width: 100%;
    height: 45px;
    line-height: 45px;
    margin: 0;
    text-align: center;

	}	
.column p span{
	width:50%;
	float:left;
	display:inline-block;

	}
.column p em{
    position: absolute;
    height: 44px;
    background-color: #ddd;
    line-height: 44px;
    width: 1px;
    left: 50%;
    top: 0;
	}		
.column .bottom{
    width: 100%;
    height: 45px;
    line-height: 45px;
    margin: 0;
    border-top: 1px #ddd solid;
	position:relative;
	}	
</style>
<div class="main">
	<div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
            <form action="{php echo $this->createWebUrl('txrecord')}" method="get" class="form-horizontal">
            <input type="hidden" name="c" value="site">
        	<input type="hidden" name="a" value="entry">
        	<input type="hidden" name="m" value="dashen_zaoqizhuanqian">
        	<input type="hidden" name="do" value="txrecord">
            <div class="form-group">
            	<label class="col-xs-12 col-sm-3 col-md-2 control-label">选择日期</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <input type="text" name="date" value="{$date}" placeholder="请选择日期时间" readonly="readonly" class="datetimepicker form-control" style="padding-left:12px;">
                    <script type="text/javascript">
                    require(["datetimepicker"], function(){
                        var option = {
                        lang : "zh",
                        step : 5,
                        timepicker : false,
                        closeOnDateSelect : true,
                        format : "Y-m-d"
                        };
                        $(".datetimepicker[name = 'date']").datetimepicker(option);
                    });
                    </script> 
                </div>
            </div>
            <div class="form-group">
           		<label class="col-xs-12 col-sm-3 col-md-2 control-label">状态：</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                    <select class="form-control" name="tx_state" id="tx_state">
                    <option {php echo $tx_state==''?'selected="selected"':'';} value="">请选择</option>
                    <option {php echo $tx_state=='1'?'selected="selected"':'';} value="1">成功</option>
                    <option {php echo $tx_state=='2'?'selected="selected"':'';} value="2">失败</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
            	<label class="col-xs-12 col-sm-3 col-md-2 control-label">用户昵称:</label>
                <div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
                	<input type="text" name="nickname" value="{$nickname}" class="form-control" style="display: inline-block;">
                </div>
            </div>
            <div class="form-group" style="text-align:center;">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                	<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
            </form>
        </div>
    </div>

    <div class="panel panel-info">
	    <div class="panel-heading">提现记录</div>
	    
	    {if $list}
	    <div class="panel-body">
            <table class="table table-hover">
            <thead class="navbar-inner">
                <tr>
                    <th width="100">用户OPENID/账号</th>
                    <th>昵称/姓名</th>
                    <th >头像</th>
                   
                    <th>提现金额</th>
					 <th >体现方式</th>
                    <th>支护宝账户</th>
                    <th>支护宝姓名</th>
                    <th>姓名</th>
                    <th>卡号</th>
                    <th>提现银行</th>
                    <th>提现开户行</th>
                    <th>提现日期</th>
                    <th>提现状态</th>                 

                </tr>
            </thead>
            <tbody id="table_content" >               
				{loop $list $l}
                <tr  >
                    {if $l['zhanghao']!=''}
                    <td style="line-height:25px;">{$l['zhanghao']}</td>
                    <td>{$l['name']}</td>
                    {else}
                    <td style="line-height:25px;">{$l['openid']}</td>
                    <td>{$l['nickname']}</td>
                    {/if}

                    <td><img src="{$l['headimgurl']}" width="50" height="50" alt="" /></td>
                    <td>					
                    {$l['tixian_money']}					
                    </td>
					<td>
					  {if $l['type'] == 'alipay'}
                        <span class="btn btn-success" >支付宝</span>
                        {else}
                        <span class="btn btn-info">银行卡</span>
                        {/if}
						</td>
					 <td>
						 {if $l['type'] == 'alipay'}
                        {$l['name']}
						 {/if}
                    </td>
					 <td>
					  {if $l['type'] == 'alipay'}
                        {$l['zhanghao']}
						 {/if}
                    </td>
					 <td>
					  {if $l['type'] == 'bankpay'}
                        {$l['name']}
						 {/if}
                    </td>
					 <td>
					  {if $l['type'] == 'bankpay'}
                        {$l['zhanghao']}
						 {/if}
                    </td>
                    <td>
                        {$l['bank']}
                    </td>
                    <td>
                        {$l['kbank']}
                    </td>
                    <td>					
					{$l['tixian_data']}
					</td>
					<td>
                        {if $l['zhanghao']!=''}
                        {if $l['tixian_state'] == 1}
                        <span class="btn btn-success" >转账成功</span>
                        {elseif $l['tixian_state'] == 2 }
                        <span class="btn btn-info">已退回</span>
                        {else}
                        <span class="btn btn-info" onclick="tixians({$l[id]},{$l[uniacid]})">待转账</span>
                        <span class="btn btn-info" onclick="tui({$l[id]},{$l[uniacid]})">退回</span>
                        {/if}
                        {else}
						{if $l['tixian_state'] == 1}
                            <span class="btn btn-success" >提现成功</span>
                        {elseif $l['tixian_state'] == 2 }
                        <span class="btn btn-info">已退回</span>
                        {else}
                            <span class="btn btn-info" onclick="tixian({$l[id]},{$l[uniacid]})">待审核</span>
                            <span class="btn btn-info" onclick="tui({$l[id]},{$l[uniacid]})">退回</span>
                        {/if}
                        {/if}

					</td>		
                </tr>  
				 {/loop}
            </tbody>
        </table>
        {$pager}
		{else}
			<h4 style="text-align:center;">还没有数据</h4>
		{/if}

	    </div>
	</div>
</div>

<script>
    function tixian(id) {
        var a=confirm('确定通过？');
        if(a==false){
            return false;
        }
        var url1 = "{php echo $this->createWebUrl('Tixian1')}";
        $.ajax({
            url: url1,
            data:{id : id},
            type: 'post',
            success:function(Data){
                if(Data==1){
                window.location.reload();
                }else if(Data==2) {
                  alert('请勿频繁点击');
                }else{
                    alert(Data);
                }

            },

        });
    }
    function tixians(id) {
        var a=confirm('确定已转？');
        if(a==false){
            return false;
        }
        var url1 = "{php echo $this->createWebUrl('Tixian1')}";
        $.ajax({
            url: url1,
            data:{id : id},
            type: 'post',
            success:function(Data){
                if(Data==1){
                    window.location.reload();
                }else {
                    alert(Data);
                }

            },

        });
    }
    function tui(id) {
        var a=confirm('确定退回？');
        if(a==false){
            return false;
        }
        var url1 = "{php echo $this->createWebUrl('tui')}";
        $.ajax({
            url: url1,
            data:{id : id},
            type: 'post',
            success:function(Data){
                if(Data==1){
                    window.location.reload();
                }else {
                    alert(Data);
                }

            },

        });
    }
</script>
{template 'common/footer'}